package zuoye.zy4;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;

public class Test {
    public static void main(String[] args) {
//        创建一个集合存储5个人的名称
        ArrayList<String> names = new ArrayList<>();
        names.add("小王");
        names.add("小张");
        names.add("小李");
        names.add("小赵");
        names.add("小王");
//        创建一个集合存储5个阄的内容
//       String[]  punished = {"被抓", "被关", "被杀", "被砍", "被分尸"};
        ArrayList<String> punished = new ArrayList<>();
        punished.add("被抓");
        punished.add("被关");
        punished.add("被杀");
        punished.add("被砍");
        punished.add("被分尸");
        for (int i = 0; i < names.size(); i++) {
          String name=names.get(i);
          int index=new Random().nextInt(punished.size());
          System.out.println(name+punished.get(index)+"了");
          punished.remove(index);

        }

    }

}
